
<script>
$().ready(function(){
    $(".datetime_picker").datetimepicker({
        "dateFormat": 'yy-mm-dd' 
    });
});
    
</script>

<h2><?php echo $title; ?></h2>
<div class="underline">&nbsp;</div>
<div id="inner-container">
    <?php echo isset($errors) ? '<span class="form-msg-error">'.$errors.'</span>' : '' ?>
    <?php echo validation_errors();?>
    <br/>
     <form class="form" action="<?php echo $form_url?>" method="post" accept-charset="utf-8">
         <fieldset>
            <legend>Schedule Information</legend>
            
            
            
            
            <div class="grid-6-12">
                <label class="form-lbl" for="cinema_id">Cinema <em class="form-req">*</em></label>
                <select name="cinema_id" id="cinema_id">
                    <?php foreach ($cinemas as $key => $cinema) :?>
                        <option value="<?php echo $cinema->id?>" <?php echo set_select('cinema_id', $cinema->id, isset($schedule) ? ($cinema->id == $schedule->cinema_id) : FALSE)?>><?php echo $cinema->branch_name?> - <?php echo $cinema->name?></option>
                    <?php endforeach;?>
                </select>
            </div>
            
            <div class="grid-6-12">
                <label class="form-lbl" for="movie_id">Movie <em class="form-req">*</em></label>
                <select name="movie_id" id="movie_id">
                    <?php foreach ($movies as $key => $movie) :?>
                        <option value="<?php echo $movie->id?>" <?php echo set_select('movie_id', $movie->id, isset($schedule) ? ($movie->id == $schedule->movie_id) : FALSE)?>><?php echo $movie->title?></option>
                    <?php endforeach;?>
                </select>
            </div>
            
            <div class="grid-6-12">
                <label class="form-lbl" for="title">Start Time <em class="form-req">*</em></label>
                <input class="form-txt datetime_picker" type="text" name="start_time" id="start_time" value="<?php echo set_value('start_time', isset($schedule) ? $schedule->start_time : '')?>" />
            </div>
            
            <div class="grid-6-12">
                <label class="form-lbl" for="title">End Time <em class="form-req">*</em></label>
                <input class="form-txt datetime_picker" type="text" name="end_time" id="end_time" value="<?php echo set_value('end_time', isset($schedule) ? $schedule->end_time : '')?>" />
            </div>
            
            
            <div class="grid-12-12 form-no-lbl">
                <input class="form-button form-right" type="submit" name="submit" value="submit" id="submit" />
            </div>
            
        </fieldset>
        
    </form>
</div>
